<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title><?php echo ($title); ?></title>
  <meta name="description" content="这是一个 help 页面">
  <meta name="keywords" content="help">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" /> 
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" type="text/css" href="/zxtms/Public/assets/css/amazeui.min.css" />
  <link rel="stylesheet" type="text/css" href="/zxtms/Public/assets/css/admin.css" />
  <script type="text/javascript" src="/zxtms/Public/assets/js/jquery.min.js"></script>
   <script type="text/javascript" src="/zxtms/Public/assets/js/amazeui.min.js"></script>
</head>
<body>
<style>
#nav_current{
	background:#0E90D2;
	color:#ffffff;
}
</style>
<header class="am-topbar am-topbar-inverse admin-header">
  <div class="am-topbar-brand">
    <strong>河南志信科技有限公司——</strong> <small>出差管理系统</small>
  </div>
  <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>
  <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
    <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">   
    <?php if(empty($_SESSION['name'])): ?><li><a href="<?php echo U('Login/login');?>"><span class="am-icon-user"></span> 登录</a></li>
    <?php else: ?>
        <li><a href=""><span class="am-icon-user"></span>  欢迎您：<?php echo (session('name')); ?></a></li> 
          <li><a href="<?php echo U('Login/logout');?>"><span class="am-icon-sign-out"></span>注销</a></li><?php endif; ?>                                    
    </ul>
  </div>
</header>

<div class="am-cf admin-main">
  <!-- sidebar start -->
  <div class="admin-sidebar am-offcanvas am-dh">
    <div class="am-offcanvas-bar admin-offcanvas-bar">    
      <ul class="am-list admin-sidebar-list" id="nav">
       <li><a class="active" href="<?php echo U('Admin/Index/index');?>"><span class="am-icon-home"></span> 首页</a></li>
        <li class="admin-parent">
          <a class="am-cf" data-am-collapse="{target: '#collapse-nav2'}"> 员工管理 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
          <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav2">
           <?php if(($_SESSION['uid']) == "1"): ?><li><a class="active" href="<?php echo U('Admin/Staff/add');?>" class="am-cf">员工入职</a></li><?php endif; ?>
            <li><a class="active" href="<?php echo U('Admin/User/view');?>" class="am-cf">发布任务</a></li>
            <li><a class="active" href="<?php echo U('Admin/Group/view');?>"> 出差管理</a></li>           
            <li><a class="active" href="<?php echo U('Admin/Rule/view');?>"> 出差统计</a></li>
            <li><a class="active" href="<?php echo U('Admin/Rule/view');?>"> 请假管理</a></li>              
          </ul>
        </li>   
        <li class="admin-parent">
          <a class="am-cf" data-am-collapse="{target: '#collapse-nav'}"> 权限管理 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
          <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav">
            <li><a class="active" href="<?php echo U('Admin/User/view');?>" class="am-cf"> 系统管理人员</a></li>
            <li><a class="active" href="<?php echo U('Admin/Group/view');?>"> 角色管理</a></li>           
            <li><a class="active" href="<?php echo U('Admin/Rule/view');?>"> 权限列表</a></li>                  
          </ul>
        </li>             
      </ul>
    </div>
  </div>
  <!-- sidebar end -->

  <!-- content start -->
  <div class="admin-content"> 
    <div class="admin-content-body">  
      <hr/>
     
<style>
.layui-form-label{
	width:110px !important;
	
	
}
</style>
<link rel="stylesheet" type="text/css" href="/zxtms/Public/layui/css/layui.css" />

  <form class="layui-form" action="<?php echo ($url); ?>" method="post" >
   <input type="hidden" name="id" value="<?php if(!empty($editinfo["id"])): echo ($editinfo["id"]); endif; ?>">	
  <div class="layui-form-item">
    <label class="layui-form-label">管理员：</label>
    <div class="layui-input-block">
      <input type="text"  name="name" lay-verify="name" value="<?php if(!empty($editinfo["name"])): echo ($editinfo["name"]); endif; ?>" autocomplete="off" placeholder="请输入姓名" class="layui-input">
    </div>
  </div>
  
   <div class="layui-form-item">
    <label class="layui-form-label">密码:</label>
    <div class="layui-input-block">
      <input type="password" name="password" lay-verify="password" value="<?php if(!empty($editinfo["password"])): echo ($editinfo["password"]); endif; ?>"  placeholder="请输入密码" autocomplete="off" class="layui-input">
    </div>
  </div>
  
   <div class="layui-form-item">
    <label class="layui-form-label">确认密码：</label>
    <div class="layui-input-block">
      <input type="password"  name="repassword" lay-verify="repassword"  value="<?php if(!empty($editinfo["password"])): echo ($editinfo["password"]); endif; ?>" autocomplete="off" placeholder="确认密码" class="layui-input">
    </div>
  </div>
 
   <div class="layui-form-item">
      <label class="layui-form-label">所属角色：</label>
      <div class="layui-input-block">
        <select name="group_id" lay-verify="required" lay-search="">
          <option value="">请选择</option>
          <?php if(is_array($grouplist)): $i = 0; $__LIST__ = $grouplist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["id"]); ?>" <?php if(($vo["id"]) == $groupId["group_id"]): ?>selected<?php endif; ?>><?php echo ($vo["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>         
        </select>
      </div>
    </div> 
 
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="am-btn am-btn-primary" lay-submit="submit" ><?php echo ($info); ?></button>   
    </div>
  </div>
  
</form>

   
<script type="text/javascript" src="/zxtms/Public/layui/layui.js"></script>
<script>
layui.use(['form'], function(){
  var form = layui.form()
  ,layer = layui.layer  
  form.verify({
    name: function(value){
      if(value.length < 2){
        return '用户名至少得2个字符啊';
      }
    },
    password: function(value){
        if(value === ""){
        	return "密码不能为空！";
        }      
        var regExpDigital = /\d/; //如果有数字
	    var regExpLetters = /[a-zA-Z]/; //如果有字母
	    if (!(regExpDigital.test(value) && regExpLetters.test(value) && value.length >= 8)) {
	        return '密码必须包含英文和数字！';
	    }         
      },
      repassword: function(value) {
    	    if (value === "") {
    	    	 return "请输入二次密码！";
    	    }    	     
    	    var pwd = $('input[name=password').val();
    	    if (pwd !== value) {
    	    	  return "二次输入的密码不一致！";
    	    }
    	    
    	},
   	
  });  
});
</script>

        
      

 </div>
    <footer class="admin-content-footer">
      <hr>
      <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
    </footer>
  </div>
  <!-- content end -->

<script type="text/javascript">
		var obj=null;	
		var As=document.getElementsByClassName("active");
		obj = As[0];
		for(i=1;i<As.length;i++){
			if(window.location.href.indexOf(As[i].href)>=0)
		obj=As[i];
			}
		obj.id='nav_current';		
		
</script>


</div>



</body>
</html>